<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="checkbox" id="ck" />
		<hr />
		<div id="div">
			<input type="checkbox"/><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" />
		</div>
	</body>
</html>
<script>
     let a= document.getElementById("ck");
     a.onclick=function(){
         let b=document.getElementById("div");
         let c=b.children;
         for (let i= 0; i < c.length;i++) {
              let d=c[i];
              d.checked=this.checked;    
         }

     }


</script>